<?php
$id = intval($_GET['id']);
$chem = ($_GET['chem']);

$con = mysqli_connect('localhost','root','','djoa');
if (!$con)
  {
  die('Could not connect: ' . mysqli_error($con));
  }

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM photos WHERE id_photo = '".$id."'";
$result = mysqli_query($con,$sql);


while($row = mysqli_fetch_array($result))
  {
  echo "<div class='modal-header'>
        <button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button>
        <h4 class='modal-title'>".$row['nom']."</h4>
      </div>
	  <div class='row'>
      <div class='modal-body'>
		<div class='col-lg-12'>
			<a href='#' ><img id='monimg' src='".$chem."' alt='pots'>
			</a>
		</div>
		</div>
      </div>
      <div class='modal-footer'>
        <p class='center'>".
			$row['desc']."
		</p>
      </div>";
  }

mysqli_close($con);
?>